const http = require("./http")
class MusicHttp extends http{
    static getBannerMusicHttp(){
        return this.request("3000/banner")
    }
    static getHotMusicHttp(){
        return this.request("3000/top/playlist/highquallity")
    }
    static getNewMusicHttp(){
        return this.request("3000/album/newest")
    }
    static getDjMusicHttp(){
        return this.request("3000/personalized/djprogram")
    }
    static getSearchMusicHttp(id){
        return this.request(`3000/search?keywords=${id}`)
    }
    static getSongMusicHttp(ids){
        return this.request(`3000/song/detail?ids=${ids}`)
    }
    static getCityHttp(){
        return this.request("8000/city")  
    }
    static async show(value){
        var data = []
        var Res = await (this.getCityHttp());
        var cities = Res.data.data.cities;
        console.log(cities);
        for(var k in cities){
            console.log(k);
            if(k==value){
                data = cities[k]
                break
            }else{
                cities[k].forEach(item=>{
                if(item.spell.includes(value)||item.name.includes(value)){
                    data.push(item.name)
                }
            })
            }
           
        }
        console.log(data);
        return data;

    }
}
module.exports = MusicHttp;